Allow up to (and including) BABL_MAX_COMPONENTS
authorMukund Sivaraman <muks@banu.com>
Thu, 26 Feb 2015 14:51:18 +0000 (20:21 +0530)
committerMukund Sivaraman <muks@banu.com>
Thu, 26 Feb 2015 14:51:18 +0000 (20:21 +0530)
babl/babl-model.c

index 91c57ee2c12a0ac61c643f9ff1d8c5e9a2008a19..fec520923e0abae3c8aba0c305630722425af570 100644 (file)
@@ -118,14 +118,12 @@ babl_model_new (void *first_argument,
           switch (bablc->class_type)
             {
               case BABL_COMPONENT:
-                component [components] = (BablComponent *) bablc;
-                components++;
-
                 if (components >= BABL_MAX_COMPONENTS)
                   {
                     babl_log ("maximum number of components (%i) exceeded for %s",
                               BABL_MAX_COMPONENTS, assigned_name);
                   }
+                component [components++] = (BablComponent *) bablc;
                 break;
 
               case BABL_MODEL: